<%@page import="com.kaishengit.util.StringUtil"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>登录系统</title>
  </head>
  <body>
  <img alt="" src="static/img/logo.png">
  <c:choose>
  	<c:when test="${param.code=='10001' }">
  		<div style="color:red">用户名或密码不能为空!</div>
  	</c:when>
  	<c:when test="${param.code=='10002' }">
  		<div style="color:red">用户名或密码错误!</div>
  	</c:when>
  	<c:when test="${param.code=='10003' }">
  		<div style="color:red">该用户不存在!</div>
  	</c:when>
  	<c:when test="${param.code=='10008' }">
  		<div style="color:red">请先登陆!</div>
  	</c:when>
  </c:choose>
  <form action="login.jspx" method="post" id="myform">
  	用户名:<input type="text" id="uname" name="username" /><span id="unameInfo"></span><br />
  	密码 :<input type="password" id="pwd" name="password" /><span id="pwdInfo"></span><br />
  	<input type="button" id="btn" value="进入系统" />
  </form>
  <noscript>
  你的浏览器不支持script	请更换浏览器!
  </noscript>
  <script type="text/javascript" language="javascript">
	 function G(id){
		return document.getElementById(id);
	}
	
	G("btn").onclick=function(){
		if(G("uname").value.trim().length==0){
			alert("请填写用户名");
			G("uname").focus();
			G("unameInfo").innerHTML="<font style='font-size:14px;color:red'>请填写用户名</font>";
			return;
		}
		if(G("pwd").value==""){
			alert("请填写密码");
			G("pwd").focus();
			G("pwdInfo").innerHTML="<font style='font-size:14px;color:red'>请填写密码</font>";
			return;
		}
		
		G("myform").submit();
	};
	G("uname").onkeyup=function(){
		G("unameInfo").innerHTML="";
	};
	G("pwd").onkeyup=function(){
		G("pwdInfo").innerHTML="";
	};
 </script>
  </body>
</html>
